import java.util.Scanner;

/**
 * \* Created with IntelliJ IDEA.
 * \* User: Administrator
 * \* Date: 2022/3/31
 * \* Time: 22:17
 * \* To change this template use File | Settings | File Templates.
 * \* Description:
 * \
 */
public class TestDemo2 {

    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String str = sc.nextLine();
        int count = 0;
        for(int i =0;i<str.length();i++){
            if(str.charAt(i) == '"'){
                while(str.charAt(i+1) != '"' ){
                    i++;
                }
                i++;
                count++;
            }
            if(str.charAt(i) == ' '){
                count++;
            }
        }
        System.out.println(count);
    }

    public static void main35(String[] args){
        Scanner in=new Scanner(System.in);
        int n = in.nextInt();
        int i = n/2;//从中间开始找
        while(i > 0){
            if(isPrime(i) && isPrime(n-i)){
                System.out.println(i);
                System.out.println(n-i);
                break;
            }
            i--;
        }
    }
    public static boolean isPrime(int n){
        for(int i =2;i<n/2 ;i++){
            if(n % i ==0){
                return false;
            }
        }
        return true;
    }


    static class Counter {
        public volatile int flag = 0;
    }
    public static void main34(String[] args) {
        Counter counter = new Counter();
        Thread t1 = new Thread(() -> {
            while (counter.flag == 0) {
// do nothing
            }
            System.out.println("循环结束!");
        });
        Thread t2 = new Thread(() -> {
            Scanner scanner = new Scanner(System.in);
            System.out.println("输入一个整数:");
            counter.flag = scanner.nextInt();
        });
        t1.start();
        t2.start();
    }
}
